#pragma once
#include<iostream>
#include<vector>
#include<ctime>
typedef void (*task)();
//debug任务
void printlog()
{
    std::cout<<"打印日志"<<std::endl;
}
void download()
{
    std::cout<<"下载文件"<<std::endl;
}
void upload()
{
    std::cout<<"上传文件"<<std::endl;
}
void compresstask()
{
    std::cout<<"压缩文件"<<std::endl;
}
void decompresstask()
{
    std::cout<<"解压缩文件"<<std::endl;
}
void encrypt()
{
    std::cout<<"加密文件"<<std::endl;
}
void decrypt()
{
    std::cout<<"解密文件"<<std::endl;
}
class taskmanager 
{
public:
    taskmanager()
    {
        srand(time(0));
    }
    int code()
    {
        return rand()%_tasks.size();
    }
    void gettasks(task t)
    {
        _tasks.push_back(t);
    }
    void execute(int code)
    {
        _tasks[code]();
    }
    int size()
    {
        return _tasks.size();
    }
    ~taskmanager()
    {}
private:
    std::vector<task> _tasks;
};